package com.jrx.anytxn.investor.service;


import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.investor.entity.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 出资方总账流水接口
 *
 * @author liuyang
 * @date 2020-05-20
 */
public interface IInvestorGlInterfaceService {

    /**
     * 交易账户生成GL
     *
     * @param accountMainInvestorInfo 交易账户
     * @param glAmt 交易金额
     * @param txnCode 交易码
     * @param accountingPhase 会计状态
     * @param businessDate 业务日期
     * @return TlGlInterfaceInvestorInfo 总账流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-20
     */
    TlGlInterfaceInvestorInfo buildTlGlInterfaceInvestorInfo(AmAccountMainInvestorInfo accountMainInvestorInfo, BigDecimal glAmt, String txnCode, String accountingPhase, Date businessDate) throws TxnException;
    
    /**
     * 生成还款总账流水
     * @param paymentLogList
     * @return
     * @throws TxnException
     */
    List<TlGlInterfaceInvestorInfo> buildTlGlInterfaceInfoList(List<TlPaymentAllocationInvestorLog> paymentLogList) throws TxnException;

    /**
     * 计提账户  生成税金计提gl
     *
     * @param businessDate 业务日期
     * @param amInterestAccrualInfo 累计账户
     * @param taxAmt 税金
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-26
     */
    TlGlInterfaceInvestorInfo generateGlInterfaceForAcccrualTax(Date businessDate, AmInterestAccrualInvestorInfo amInterestAccrualInfo, BigDecimal taxAmt) throws TxnException;

    /**
     * 计提账户  生成计提gl
     *
     * @param businessDate
     * @param amInterestAccrualInfo
     * @param taxAmt 税金
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-26
     */
    TlGlInterfaceInvestorInfo generateGlInterfaceForAcccrual(Date businessDate, AmInterestAccrualInvestorInfo amInterestAccrualInfo,BigDecimal taxAmt) throws TxnException;

    /**
     * 累计账户生成成GL
     *
     * @param amInterestAccrualInfo 累计账户
     * @param glAmt 交易金额
     * @param txnCode 交易码
     * @param orgiStatus 会计状态
     * @param business 业务日期
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-27
     */
    TlGlInterfaceInvestorInfo buildTlGlInterfaceInvestorInfo(AmInterestAccrualInvestorInfo amInterestAccrualInfo, BigDecimal glAmt, String txnCode, String orgiStatus, Date business) throws TxnException;

    /**
     * 订单生成GL
     *
     * @param amLoanAccountInfo 订单账户信息
     * @param amLoanMainInfo 订单信息
     * @param txnCode 交易码
     * @param orgiStatus 会记状态
     * @param bussinessDate 业务日期
     * @param prinNonAccrualFlag 本金转非应计标志  0不转列  1转列
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-27
     */
    TlGlInterfaceInvestorInfo buildTlGlInterfaceInvestorInfo(AmLoanAccountInvestorInfo amLoanAccountInfo, AmLoanMainInvestorInfo amLoanMainInfo, String txnCode, String orgiStatus, Date bussinessDate, String prinNonAccrualFlag) throws TxnException;

    /**
     * 贷款时总账流水生成
     *
     * @param amLoanMainInfo    订单信息
     * @param amLoanAccountInfo 订单账户账户信息
     * @param productName       产品名称
     * @param business          业务日期
     * @param liabilityFlag     债务归属
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-05-28
     */
    TlGlInterfaceInvestorInfo buildTlGlInterfaceInvestorInfo(AmLoanMainInvestorInfo amLoanMainInfo, AmLoanAccountInvestorInfo amLoanAccountInfo, String productName, Date business, String liabilityFlag) throws TxnException;

    /**
     * 生成取消订单GL
     *
     * @param orgiGl 原GL流水
     * @param businessDate 业务日期
     * @return TlGlInterfaceInvestorInfo GL流水
     * @throws TxnException
     * @author liuyang
     * @date 2020-06-15
     */
    TlGlInterfaceInvestorInfo buildTlGlInterfaceInvestorInfo(TlGlInterfaceInvestorInfo orgiGl, Date businessDate) throws TxnException;
}
